#include<iostream>
#include<string>
#include<map>
using namespace std;
int main(){
    string s1,s2;
    getline(cin,s1);
    getline(cin,s2);
    map<char,int> table;
    for(int i=0;i<s2.length();i++){
	table[s2[i]]=1;//show in s2
    }
    for(int i=0;i<s1.length();i++){
	if(table[s1[i]]==1){
	    continue;
	}
	cout<<s1[i];
    }
    cout<<endl;
}
